package geektime.concurrent.part1;

public class MyThread implements Runnable{
    @Override
    public void run() {
        // 打印当前前程的名称和状态
        Thread t = Thread.currentThread();
        System.out.print(t.getName());
        System.out.println(", aliveStatus=" + t.isAlive());
    }

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new MyThread());
        // Cause this thread begin to execute, and the JVM will call the <code>run</code> method
        t.start();
        // wait for this thread to die
        t.join();
        System.out.print(t.getName());
        System.out.println(", aliveStatus=" + t.isAlive());
    }
}
